<?php #//v.3.3.0
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('../includes/config.inc.php');
include "loggedin.inc.php";
include $include_path.'fonts.inc.php';


#//
$ERR = "";

#//
if($_POST[action] == "update" && phpa_securepost($_POST))
{
	if ( strlen ($_POST['acceptancetext']) > 300 )
		  $_POST['acceptancetext'] = substr ( $_POST['acceptancetext'],0,300 );
	
	$query = " UPDATE PHPAUCTIONXL_settings SET
				   showacceptancetext=$_POST[showacceptancetext],
				   acceptancetext='".addslashes($_POST[acceptancetext])."'";
	$res_ = @mysql_query($query);
	if(!$res_)
	{
		print "Error: $query<BR>".mysql_error();
		exit;
	}
	else
	{
		$SETTINGS = $_POST;
		$ERR = $MSG_25_0111;
	}
}

#//
$query = "SELECT * FROM PHPAUCTIONXL_settings";
$res = @mysql_query($query);
if(!$res)
{
	print "Error: $query<BR>".mysql_error();
	exit;
}
elseif(mysql_num_rows($res) > 0)
{
	$SETTINGS = mysql_fetch_array($res);
}

?>
<HTML>
<HEAD>
<link rel='stylesheet' type='text/css' href='style.css' />
<script type="text/javascript" src="../js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
	mode : "textareas",
	theme : "advanced",
	language: "en",
	plugins : "table",
	theme_advanced_buttons1 : "backcolor, forecolor, bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
	theme_advanced_buttons2 : "fontselect, fontsizeselect",
	theme_advanced_buttons3 : "tablecontrols",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	force_br_newlines : "false",
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script>
<link href="css/main.css" rel="stylesheet" type="text/css">
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" link="#0066FF" vlink="#666666" alink="#000066" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titulo">
        <tr> 
          <td class="icono"><img src="images/users_icon2.gif" width="17" height="23"></td>
          <td class="breadcrumbs"><p><span><?=$MSG_25_0010?></span>&nbsp;&gt;&gt;&nbsp;<?=$MSG_25_0110?></p></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
    <tr> 
    <td align="center" valign="middle">
<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0 BGCOLOR="#FFFFFF">
<TR>
<TD align="center">
<BR>
<FORM NAME=conf ACTION="<?=basename($_SERVER['PHP_SELF'])?>" METHOD="POST"  ENCTYPE="multipart/form-data">
	<TABLE WIDTH="95%" BORDER="0" class="base" cellpadding="0" cellspacing="0"  style="border:1px solid #ccc;">
		<TR>
			<TD ALIGN=CENTER class=title>
				<p><? print $MSG_25_0110; ?></p>
				</TD>
		</TR>
		<TR>
	<TD>
		<TABLE WIDTH=100% cellpadding="0" cellspacing="0">
		  <?
		  if($ERR != "")
		  {
		?>
		  <TR>
			<TD class=error COLSPAN="2"><p><? print $ERR; ?></p></TD>
		  </TR>
		  <?
		  }
		?>
		  <tr valign="TOP">
			<td colspan="2"><img src="../images/transparent.gif" width="1" height="5"></td>
		  </tr>

		  <tr valign="TOP">
			<td width=169 class="line">
			  <p class="blue"><? print $MSG_534; ?></p>
			  </td>
			<td width="393" class="line">
			  <? print $MSG_539; ?>
			  <br>
			  <input type="radio" name="showacceptancetext" value="1"
					 <? if($SETTINGS[showacceptancetext] == 1) print " CHECKED";?>
					 >
			  <? print $MSG_030; ?>
			  <input type="radio" name="showacceptancetext" value="2"
					 <? if($SETTINGS[showacceptancetext] == 2) print " CHECKED";?>
					 >
			  <? print $MSG_029; ?>
			   </td>
		  </tr>
		  <tr valign="TOP">
			<td width=169></td>
			<td width="393">
			  <textarea name="acceptancetext" cols="55" rows="10"><?=stripslashes($SETTINGS[acceptancetext])?></textarea>
			</td>
		  </tr>
		  <TR>
			<TD WIDTH=169 class="gris">
			  <INPUT TYPE="hidden" NAME="action" VALUE="update" /> <INPUT TYPE="hidden" NAME="security" VALUE="<?php echo $_SESSION['security'];?>" />
			</TD>
			<TD WIDTH="393"  class="gris">
			<INPUT TYPE="submit" NAME="act" VALUE="<? print $MSG_530; ?>" class="action">
			</TD>
		  </TR>
		  <TR>
			<TD WIDTH=169 height="4"></TD>
			<TD WIDTH="393"> </TD>
		  </TR>
		</TABLE>
	</TD>
	</TR>
	</TABLE>
	</FORM>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
